#pragma once
#include <math.h>

namespace lib3dw 
{
	enum Coordinate {x, y, z, u, v};

	struct Vector2 
	{
		float x, y;

		Vector2()
		{
			x = y = 0.0;
		}
		
		Vector2(const float ixy)
		{
			x = y = ixy;
		}

		Vector2(const float ix, const float iy)
		{
			x = ix;
			y = iy;
		}

		operator float *() const 
		{
			return (float *) &x; 
		}

		void operator += (const float s);
		void operator += (const Vector2 &v);
		void operator -= (const float s);
		void operator -= (const Vector2 &v);
		void operator *= (const float s);
		void operator *= (const Vector2 &v);
		void operator /= (const float s);
		void operator /= (const Vector2 &v);
	};

	Vector2 operator + (const Vector2 &u, const Vector2 &v);
	Vector2 operator + (const Vector2 &v, const float s);
	Vector2 operator + (const float s, const Vector2 &v);
	Vector2 operator - (const Vector2 &u, const Vector2 &v);
	Vector2 operator - (const Vector2 &v, const float s);
	Vector2 operator - (const float s, const Vector2 &v);
	Vector2 operator - (const Vector2 &v);
	Vector2 operator * (const Vector2 &u, const Vector2 &v);
	Vector2 operator * (const float s, const Vector2 &v);
	Vector2 operator * (const Vector2 &v, const float s);
	Vector2 operator / (const Vector2 &u, const Vector2 &v);
	Vector2 operator / (const Vector2 &v, const float s);
	Vector2 operator / (const float s, const Vector2 &v);
	bool operator == (const Vector2 &u, const Vector2 &v);
}